<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%-- JSTL表达式（判断，循环，输出） --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%-- 方法表达式（字符串截取，替换） --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>活动详情</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge，chrome=1">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta name="renderer" content="webkit">
    <meta name="baidu-site-verification" content="R9XA5lWxu2"/>
    <meta name="author" content="图腾">
    <meta name="keywords" content="图腾">
    <meta name="description" content="图腾">
    <link rel="stylesheet" href="<%=basePath%>plugins/swiper/css/swiper.min.css">
    <link rel="stylesheet" href="<%=basePath%>css/ys.css">
</head>
<body>

<jsp:include page="${basePath}/common.jsp" />

<div class="detail-wrap bg-f3f2f1 ">
    <div class="container">
        <div class="tag-box">
            <c:if test="${returnUrl!=null}">
                <a href="javascript:window.history.go(-1);"><span class="arrow"></span><span class="title">我的订单</span></a>
            </c:if>
            <c:if test="${returnUrl==null}">
                <a href="<%=basePath%>activity/getActivityIndex"><span class="arrow"></span><span class="title">活动详情</span></a>
            </c:if>
        </div>
        <div class="room-detail-box">
            <div class="room-pic-box wh_">
                <img src="${activityInfo.activityPic}">
            </div>
            <div class="room-info-box">
                <div class="name-box">
                    <div class="name">${activityInfo.activityName}</div>
                    <div class="price">
                        ￥ ${activityInfo.activityPrice}
                    </div>
                    <div class="info">
                        ${activityInfo.activityTitle}
                    </div>
                </div>
                <div class="icon-tag-box">
                    <%--<span><i class="icon i-zan"></i><em class="num">4.8/</em>5分</span>--%>
                    <span style="cursor: pointer;" onclick="collector()"><i class="icon i-colle <c:if test="${collector!=null}">active</c:if>"></i>收藏</span>
                    <%--<span><i class="icon i-share"></i>分享</span>--%>
                </div>
                <div class="text-center">
                    <a href="<%=basePath%>order/toOrder?activityId=${activityInfo.activityId}" class="btn-pay">立即购买</a>
                </div>
                <div class="like-box text-center">
                    <div class="title">猜你喜欢</div>
                    <ul id="randActivity">
                    </ul>
                    <div class="text-center">
                        <a href="javascript:;" class="btn-in" onclick="randActivity()">换一批</a>
                    </div>
                </div>
            </div>

        </div>
    </div>

</div>

<div class="container">

    <div class="room-info-list">
        <ul class="info-box">
            <li class="active">
                <a href="#hc1">产品与活动</a>
            </li>
            <li>
                <a href="#hc2">须知</a>
            </li>
            <li>
                <a href="#hc3">位置</a>
            </li>
            <li>
                <a href="#hc4">评价</a>
            </li>
        </ul>
    </div>
    <div class="room-info-list" id="hc1">
        <div class="room-icon-box">
            <i class="icon2 i-room1"></i><br>
            <div class="name">产品与活动</div>
            <div class="en">
                This activity
            </div>
        </div>
        <div class="content-info">
            <div class="content c999">
                ${activityInfo.activityBody}
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
    <div class="room-info-list" id="hc2">
        <div class="room-icon-box">
            <i class="icon2 i-room2"></i><br>
            <div class="name">&nbsp;&nbsp;须知</div>
            <div class="en">
                Activity facilities
            </div>
        </div>
        <div class="content-info">
            <div class="content c999">
                ${activityInfo.activityNotice}
            </div>
        </div>
    </div>

    <div class="room-info-list" id="hc3">
        <div class="room-icon-box">
            <i class="icon2 i-room3"></i><br>
            <div class="name">&nbsp;&nbsp;位置</div>
            <div class="en">
                Location map
            </div>
        </div>
        <div class="content-info">
            <div class="content c999">
                ${activityInfo.activityAddress}
            </div>
        </div>
    </div>

    <div class="comment-list-box" id="hc4">
        <input type="hidden" id="serviceId" value="${activityInfo.activityId}" />
        <input type="hidden" id="serviceType" value="2" />
        <jsp:include page="${basePath}/comment/commentIndex" />
    </div>



</div>

<jsp:include page="${basePath}/footer.jsp" />

<script src="<%=basePath%>js/jquery.min.js"></script>
<script src="<%=basePath%>plugins/swiper/js/swiper.min.js"></script>
<script src="<%=basePath%>js/modal_build.js"></script>
<script src="<%=basePath%>js/modal_show.js"></script>
<script src="<%=basePath%>js/height.js"></script>
<script>
    document.documentElement.style.fontSize = 200 / 1920 * document.documentElement.clientWidth + 'px';
    window.onresize = function () {
        document.documentElement.style.fontSize = 200 / 1920 * document.documentElement.clientWidth + 'px';
    };

    randActivity();

    function randActivity(){
        $.post("<%=basePath%>activity/getRandActivitys", {}, function(data){
            $("#randActivity").html(data);
        })
    }

    function collector(){
        $.post("/user/newCollector", {serviceType: 1, serviceId: ${activityInfo.activityId}}, function (res) {
            if(res.code == 1){
                window.location.reload();
            }
        });
    }
</script>
</body>
</html>